package com.woniu.elderly.operation.service.impl;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.common.entity.Opecomment;
import com.woniu.common.entity.Opeemployee;
import com.woniu.common.entity.Openotice;
import com.woniu.common.entity.PageBean;
import com.woniu.elderly.operation.mapper.OpecommentMapper;
import com.woniu.elderly.operation.mapper.OpeemployeeMapper;
import com.woniu.elderly.operation.mapper.OpenoticeMapper;
import com.woniu.elderly.operation.service.OpecommentService;
import com.woniu.elderly.operation.service.OpenoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class OpecommentServiceImpl extends ServiceImpl<OpecommentMapper, Opecomment>
        implements OpecommentService {
    @Autowired
    OpecommentMapper opecommentMapper;

    @Override
    public void addComment(Opecomment opecomment) {
        opecomment.setCid(IdWorker.getId());
        opecommentMapper.insertComment(opecomment);
    }

    @Override
    public List<Opecomment> selectCommentsByNId(Long nid) {
        return opecommentMapper.selectCommentsByNId(nid);
    }
}
